<?php

$type = strtolower($_GET["type"]);
$to = strtolower($_GET["to"]);
$gotoURL = "http://www.terranika.com";

if ($type == "help") {
	// Tech Support Threads
	if ($to == "accents") {
		$gotoURL .= "/help/viewforum.php?f=7";
	} else if ($to == "sales") {
		$gotoURL .= "/help/viewforum.php?f=6";
	} else if (($to == "x-bot") OR ($to == "x-bot mirc script") OR ($to == "x-bot sp-1") or ($to == "otbn.tcl by overtech technologies")) {
		$gotoURL .= "/help/viewforum.php?f=4";
	} else {
		$gotoURL .= "/help";
	}
} else if($type == "blog") {
	// Blog Categories

	if ($to == "accents") {
		$gotoURL .= "/blog/?cat=14";
	} elseif ($to == "x-bot" OR $to == "x-bot sp-1") {
		$gotoURL .= "/blog/?cat=16";
	} else {	
		$gotoURL .= "/blog/?cat=4";
	}
} else if($type == "buy") {	
	echo "<h1>Hey it's your lucky day!</h1><p>Because my payment system isn't up yet, you can legally acquire the serial number to unlock this software for free.</p><p><a href=\"http://terranika.com/blog/?p=143\">Click here for instructions</a></p>";
	exit;
} 
// Otherwise dump to homepage



// Actually redirect the user
header("Location: " . $gotoURL);
exit;

?>